package com.cgy.utils.base.optional;

/**
 * 判断为空
 * @author CHTK
 */
public class OptionalHelper {

    /**
     *
     * @param function
     * @param execute
     * @param tClass
     * @param <T>
     * @return
     */
    @SuppressWarnings("unchecked")
	public static <T>T of(final Object function, final Object execute, final Class<T> tClass) {
        if(!isEmpty(function)) {
            return (T) execute;
        } else {
            return null;
        }
    }

    /**
     * 是否为空
     * @param functon
     * @return
     */
    public static boolean isEmpty(final Object functon) {
        return null == functon;
    }
}
